"""
@author: wg
@file: 字典的value.py
@time: 2023/12/12 21:02
"""

# 定义一个字典，value都为整数类型。输出字典中value的最大值以及它的key，输出字典中value的平均值

dit = {"a": 1, "b": 2, "c": 3, "d": 4, "e": 5}
i = 0
count = 0
maxmax = 0
sumsum = 0
for k, v in dit.items():
    i += 1
    sumsum += v
    if v > maxmax:
        maxmax = v
        count = k
print(f"字典中value的最大值为：{maxmax},它的key为：{count}")
print(f"字典中value的平均值为：{sumsum/i}")



